package cn.trasen.his.poc.std.api.model.major;

import cn.trasen.his.poc.std.api.emums.BedStatusEnum;
import pro.shushi.pamirs.boot.base.model.ServerAction;
import pro.shushi.pamirs.boot.base.ux.annotation.field.UxWidget;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxDetail;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxForm;
import pro.shushi.pamirs.boot.base.ux.annotation.view.UxTableSearch;
import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.IdModel;
import pro.shushi.pamirs.meta.enmu.NullableBoolEnum;

import java.util.List;

/**
 * @Description: 床位操作配置
 * @author: Jacob
 * @Date: 2024-12-19 14:04:02
 * @Company: 湖南创星科技股份有限公司
 */
@Model.model(BedOperationConfig.MODEL_MODEL)
@Model(displayName = "床位操作配置")
@Model.Advanced(unique = {"bedStatus"})
public class BedOperationConfig extends IdModel {

    public static final String MODEL_MODEL = "ts.his.BedOperationConfig";

    @UxTableSearch.FieldWidget(@UxWidget())
    @Field.Enum
    @Field(displayName = "床位状态", defaultValue = "0", required = true)
    private BedStatusEnum bedStatus;

    /**
     * 字段序列化参考：https://doc.oinone.top/oio4/9238.html
     *
     * 模型中UX相关的注解都可以不用写，Ux相关的配置都可以在设计器中进行可视化配置.
     *    这里加widget = "Select"是让默认的页面同行人交互为下拉多选的方式
     *
     * 特别说明：并不是one2many都需要指定Widget=Select，是目前这个页面让one2many的交互为下拉多选才需要指定
     *         one2many默认是表格的形式，参考：pro.shushi.pamirs.hr.api.model.org.Department#positions
     */
    @UxForm.FieldWidget(@UxWidget(widget = "Select", span = 2))
    @UxDetail.FieldWidget(@UxWidget(widget = "Select", span = 2))
    @Field.one2many
    @Field(displayName = "操作元素", serialize = Field.serialize.JSON, store = NullableBoolEnum.TRUE, required = true)
    @Field.Relation(store = false, domain = "model=='ts.his.WardBedCardProxy' and systemSource == 'MANUAL'")
    @Field.Advanced(columnDefinition = "TEXT")
    private List<ServerAction> operateElement;

}
